<template>
	<view class="content">
		<navigator hover-class="none" :url="'/pages/consulting/detail?id='+item.id" v-for="(item,index) in list"
			:key="item.id" class="list-item">
			<image mode="aspectFill" :src="item.picUrl" class="photo"></image>
			<view class="info">
				<view class="title">{{item.title}}</view>
				<!-- <view class="abstract">{{item.content}}</view> -->
				<view class="time">{{item.crtTime}}</view>
			</view>
		</navigator>
	</view>
</template>

<script>
	import {
		getNoticeList
	} from '@/api/article.js';
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			NoticeList() {
				getNoticeList({
					typeName: 2
				}).then((res) => {
					if (res.code == 1) {
						console.log(res)
						if (res.data != null) {
							this.list = res.data;
							console.log(this.list)
						}
					} else {
						console.log(res)
					}
				}).catch((res) => {
					console.log(res)
				})
			}
		},
		onLoad() {
			//this.NoticeList()
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background: #f4f4f4;
		padding: 30rpx;
		display: flex;
		flex-direction: column;

		.list-item {
			width: 100%;
			background: #fff;
			border-radius: 20rpx;
			display: flex;
			flex-direction: row;
			padding: 20rpx;
			margin-bottom: 30rpx;

			.photo {
				width: 180rpx;
				height: 180rpx;
				border-radius: 20rpx;
				margin-right: 20rpx;
			}

			.info {
				width: calc(100% - 200rpx);
				display: flex;
				flex-direction: column;

				.title {
					font-size: 34rpx;
					font-weight: bold;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}

				.abstract {
					color: $color-secondary-text;
					font-size: 28rpx;
					margin: 10rpx 0;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
				}

				.time {
					color: $color-secondary-text;
					font-size: 28rpx;
					text-align: left;
					margin-top: 80rpx;
				}
			}
		}

		.list-item:last-child {
			margin-bottom: 0;
		}
	}
</style>
